{extend name="Base/common" /}
{block name="content"}
<!-- BEGIN PAGE -->

<div class="page-content" style="padding-top: 10px;">

    <div class="container-fluid">
        <!-- 面包屑开始-->
        <div class="row-fluid">
            <div class="span12">

                <!-- BEGIN PAGE TITLE & BREADCRUMB-->
                <h3 class="page-title">
                    企业账号列表
                </h3>
                <ul class="breadcrumb">
                    <li>
                        <a href="/ops/company/index">列表</a>
                        <i class="icon-angle-right"></i>
                    </li>
                    <li>
                        企业账号列表
                    </li>

                </ul>
                <!-- END PAGE TITLE & BREADCRUMB-->
            </div>
        </div>
        <!-- 面包屑结束 -->

        <!-- 带全选的表格开始 -->
        <div class="row-fluid">

            <div class="span12">

                <!-- BEGIN SAMPLE TABLE PORTLET-->

                <div class="portlet">

                    <div class="portlet-title">

                        <div class="caption"><i class="icon-reorder"></i>用户列表</div>

                        <!-- 表格内容整体操作结束 -->

                    </div>

                    <form action="">
                        <div class="" style="display: flex">

                            <div>
                                <input type="text" value="{$query.search}" name="search" id="search" style="padding: 18px;">
                            </div>
                            <div>
                                <select name="category_id" >
                                    <option value="" >请选择一个分类</option>
                                    {foreach name='category' id='vo' key='key'}
                                    <option value="{$key}" {$key == $query.category_id?'selected':''} >{$vo}</option>
                                    {/foreach}
                                </select>
                            </div>
                            <button class=" layui-btn btn-success" >搜索</button>

                        </div>
                    </form>

                    <div class="portlet-body no-more-tables">

                        <table class="table-bordered table-striped table-condensed cf" style="text-align: center;">

                            <thead class="cf">

                            <tr>
                                <th>账号Id</th>

                                <th>账号</th>
                                <th>企业名称</th>
                                <th>类目</th>

                                <th>手机号</th>

                                <th>电话</th>
                                <th>官方二维码</th>
                                <th>详情页图片</th>

                                <th>地址</th>

                                <th>注册时间</th>

                                <th>状态</th>

                                <th>操作</th>

                            </tr>

                            </thead>

                            <tbody>

                            {volist name="list" id="vo"}
                            <tr class="">

                                <td>{$vo.id}</td>

                                <td>{$vo.account}</td>
                                <td>{$vo.name}</td>
                                <td>{$category[$vo.category_id]}</td>
                                <td>{$vo.mobile}</td>
                                <td>{$vo.tel}</td>

                                <td><img src="{$vo.qrcode}" alt="" style="height: 100px;"></td>
                                <td><img src="{$vo.ad_img}" alt="" style="height: 100px;"></td>
                                <td>{$vo.address}</td>

                                <td>{$vo.create_time}</td>

                                <td>
                                    {switch name="$vo.status" }
                                    {case value="1"}
                                    <span style="color: #e69c37">未审核</span>
                                    {/case}
                                    {case value="2"}
                                    <span style="color: #6cb2f9">审核中</span>
                                    {/case}
                                    {case value="3"}
                                    <span style="color: green">审核通过</span>
                                    {/case}
                                    {case value="4"}
                                    <span style="color: red;">审核未通过</span>
                                    {/case}
                                    {case value="5"}
                                    <span style="color: #666666">禁用</span>
                                    {/case}
                                    {/switch}
                                </td>

                                <td>
                                    <a href="/ops/company/detail?id={$vo.id}">查看详情</a>
                                    {switch name="$vo.status" }
                                    {case value="3"}
                                    | <a href="javascript:;" onclick="edit1('{$vo.id}')" >编辑</a>
                                    {/case}
                                    {case value="5"}
                                    | <a href="javascript:;" onclick="edit1('{$vo.id}')" >编辑</a>
                                    {/case}
                                    {/switch}
                                </td>

                            </tr>
                            {/volist}

                            </tbody>

                        </table>

                    </div>

                </div>
                {$list->render()}
                <!-- END SAMPLE TABLE PORTLET-->

            </div>
        </div>
        <!-- 带全选的表格结束btn-sort-edit -->

    </div>
</div>

<script>
    function edit1(id) {
        layui.use('layer', function(){
            var open = layer.open({
                type: 2,
                area: ["600px", "600px"],
                content: '/ops/company/edit?id='+id //这里content是一个URL，如果你不想让iframe出现滚动条，你还可以content: ['http://sentsin.com', 'no']
            });
            layer.full(open);

        });
    }
</script>
<!-- END PAGE -->
{/block}